import java.io.File;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;

public class Fi {
    public static void main(String[] args) throws IOException {
        String filepath = "D:\\lile\\test.txt";
        File file = new File(filepath);
        file.createNewFile();
        FileWriter writer = new FileWriter(file.getAbsolutePath());
        writer.write("姓名");
        writer.write("学号");
        writer.close();
        FileReader reader = new FileReader(file.getAbsolutePath());
        int c;
        while ((c=reader.read())!=-1){
            System.out.print((char) c);
        }
    }
}